﻿using BusinessObjects.BusinessRules;

namespace BusinessObjects.Report
{
    /// <summary>
    ///     Class that holds information about a Report Group
    /// </summary>
    public class ReportGroup : BusinessObject
    {
        /// <summary>
        /// </summary>
        public ReportGroup()
        {
            //validateId
            AddRule(new ValidateId("ReportGroupId"));
            //validateRequired
            AddRule(new ValidateRequired("IsActive"));
            AddRule(new ValidateRequired("IsTypical"));
            AddRule(new ValidateRequired("Name"));
            //validateLength
            AddRule(new ValidateLength("Name", 0, 255));
            AddRule(new ValidateLength("Description", 0, 255));
        }

        /// <summary>
        ///     Initializes a new instance of the <see cref="ReportGroup" /> class.
        /// </summary>
        /// <param name="reportGroupId">The report group identifier.</param>
        /// <param name="name">The name.</param>
        /// <param name="description">The description.</param>
        /// <param name="isActive">
        ///     if set to <c>true</c> [is active].
        /// </param>
        /// <param name="isVoucher">
        ///     if set to <c>true</c> [is voucher].
        /// </param>
        /// <param name="isTypical">
        ///     if set to <c>true</c> [is typical].
        /// </param>
        public ReportGroup(long reportGroupId, string name, string description, bool isActive, bool isVoucher,
                           bool isTypical)
            : this()
        {
            ReportGroupId = reportGroupId;
            Name = name;
            IsVoucher = isVoucher;
            IsTypical = isTypical;
            Description = description;
            IsActive = isActive;
        }

        /// <summary>
        /// </summary>
        public long ReportGroupId { get; set; }

        /// <summary>
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// </summary>
        public string Description { get; set; }

        /// <summary>
        /// </summary>
        public bool IsVoucher { get; set; }

        /// <summary>
        /// </summary>
        public bool IsTypical { get; set; }

        /// <summary>
        /// </summary>
        public bool IsActive { get; set; }
    }
}
